<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp" %>

<head>
    <title>New Transactions</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <link rel="stylesheet" href="<c:url value="/css/styles.css"/>"/>
    <script src="<c:url value="/javascripts/common.js"/>" type="text/javascript"></script>

    <link rel="stylesheet"
          href="<c:url value="/javascripts/jscalendar/theme/calendar-system.css"/>"/>
    <script src="<c:url value="/javascripts/jscalendar/calendar-cfg.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/javascripts/calendar.js"/>" type="text/javascript"></script>
    <script
            src="<c:url value="/javascripts/jscalendar/lang/calendar-en.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/javascripts/jscalendar/calendar-setup.js"/>" type="text/javascript"></script>
    <script src="<c:url value="/javascripts/jquery-1.4.4.js"/>" type="text/javascript"></script>
</head>

<body>
<div class="page">
    <%@include file="../top_menu.jsp" %>
    <table width=100%>
        <tr>
	        	<td><c:import url="/WEB-INF/jsp/menu/transaction_menu.jsp" /></td>
     	</tr>
     	<tr>
            <td>
                <%@include file="/WEB-INF/jsp/include/messages.jsp" %>
                <br/></td>
        </tr>
    </table>
    <div class="contentArea">

        <c:choose>
            <c:when test="${empty transactions.transactionDetails}">
                <tr>
                    <td colspan="12"><spring:message
                            code="sp.transactionform.label.atpresenttherearenotransactiontext"/>.<br/>
                        <spring:message code="sp.transactionform.label.ifyouwereexpectingsometransactiontext"/></td>
                </tr>
            </c:when>
            <c:otherwise>

                <table border=0 cellpadding=0 cellspacing=0 width=100%>
                    <tr>
                        <td style="font-weight: bold;"><spring:message
                                code="sp.transactionform.label.approvepayment"/></td>
                    </tr>
                    <tr>
                        <td colspan="2"><h5>STEP 2 of 2</h5></td>
                    </tr>
                    <tr>
                        <td colspan="2" style="font-size:12; color: red;  font-weight: bold;">On this page please
                            add / modify the values so that your customer can view (on his / her refund check / stub)
                            about all your service charges / fees and different payments.<br/>
                            YOU MUST COMPLETE PROCESSING ON THIS PAGE. TILL THEN THE BUTTONS ON "NEW TRANSACTIONS" PAGE
                            WILL STAY DISABLED. <br/>
                            THESE WILL GET ENABLED AFTER THE SELECTED PAYMENTS HAVE BEEN APPROVED BY YOU.<br/>
                            <span style="color: green; "><spring:message code="sp.transactionform.label.step2.note"/></span>
                        </td>
                    </tr>
                </table>

                <form:form id="main" commandName="transactions" method="post">
                    <table border=0 cellpadding=4 cellspacing=1 width=100% bgcolor="#D7D7D7">
                        <tr>
                            <td colspan="5">&nbsp;</td>
                        </tr>
                        <tr>
                        	<td colspan="18">
                        		<span style="font-weight: bold;">
                        		<form:errors path="transactionDetails" cssClass="errors"/>
                        		</span>
                       		</td>
                        </tr>
                        <tr bgcolor="#FAFAF7">
                            <td align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.ssn"/></td>
                            <td align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.customername"/></td>
                            <td align="center" width="8%" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.amountreceived"/></td>
							<td align="center" width="8%" style="font-weight: bold;">
								<spring:message code="sp.transactionform.label.svcfee"/>
							</td>
                            <td align="center" width="10%" style="font-weight: bold;">Misc. payments</td>
                            <td align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.taxprepfee"/></td>
                            <td align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.electronicpreparationfee"/></td>

                            <td width="9%" align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.electronicfillingfee"/></td>
                            <td width="7%" align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.servicebureaufee"/></td>
                            <td width="7%" align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.federalbankproductfee"/></td>

                            <td width="7%" align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.stateproductbankfee"/></td>
                            <td width="1%" align="center" style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.chooselabels"/><br>
                                <form:errors path="customLabelName1" cssClass="errors"/>
                                <form:input path="customLabelName1" size="8" maxlength="18" cssErrorClass="errorneous"/>
                             </td>

                            <td style="font-weight: bold;"><spring:message
                                    code="sp.transactionform.label.chooselabels"/><br/>
                                <form:errors path="customLabelName2" cssClass="errors"/>
                                <form:input path="customLabelName2" size="8" maxlength="18" cssErrorClass="errorneous"/></td>
                            
                            <td align="center" width="8%" style="font-weight: bold;">
								<spring:message code="sp.transactionform.label.customerBalance"/>
							</td>
                                
                            <td style="font-weight: bold;">
                            	Select <a href="#" onclick="ch_select(true);">All</a>
                                / <a href="#" onclick=" ch_select(false);">None</a></td>
                        </tr>
                        <c:forEach var="transaction" items="${transactions.transactionDetails}" varStatus="i">
                            <c:if test="${transaction.value.checked}">
                                <tr bgcolor="#FFFFFF">
                                    <td align="left">${transaction.value.customerSSN}
                                        <form:hidden path="transactionDetails[${transaction.key}].customerSSN"/>
                                    </td>
                                    <td align="left">${transaction.value.customerName}
                                        <form:hidden path="transactionDetails[${transaction.key}].customerName"/>
                                    </td>
                                    <td align="right">
                                        <form:input path="transactionDetails[${transaction.key}].amount" disabled="true"
                                                    cssClass="disabled"/>
                                        <form:hidden path="transactionDetails[${transaction.key}].amount"/>
                                    </td>
									<td align="right">
										<form:input path="transactionDetails[${transaction.key}].serviceFee" disabled="true" cssClass="disabled"/>
                                        <form:hidden path="transactionDetails[${transaction.key}].serviceFee"/>
									</td>
                                    <td align="right"><form:input
                                            path="transactionDetails[${transaction.key}].miscPayments" disabled="true"
                                            cssClass="disabled"/>
                                        <form:hidden path="transactionDetails[${transaction.key}].miscPayments"/>
                                        <form:errors path="transactionDetails[${transaction.key}]" cssClass="errors"/></td>

                                    <td><form:input path="transactionDetails[${transaction.key}].taxPrepFee" size="11"
                                                    maxlength="18" cssErrorClass="errorneous"/></td>
                                    <td width="10%">
                                        <form:input path="transactionDetails[${transaction.key}].electronicPrepFee"
                                                    size="11" maxlength="18" cssErrorClass="errorneous"/></td>
                                    <td width="9%">
                                        <form:input path="transactionDetails[${transaction.key}].electronicFillingFee"
                                                    size="11" maxlength="18" cssErrorClass="errorneous"/></td>
                                    <td width="7%">
                                        <form:input path="transactionDetails[${transaction.key}].serviceBureauFee"
                                                    size="11" maxlength="18" cssErrorClass="errorneous"/></td>
                                    <td width="7%">
                                        <form:select path="transactionDetails[${transaction.key}].fedBankProductFee">
                                            <form:option value="0">&nbsp;</form:option>
                                            <form:options items="${federalFeeList}" itemLabel="label"
                                                          itemValue="value"/>
                                        </form:select></td>
                                    <td width="7%">
                                        <form:select path="transactionDetails[${transaction.key}].stateProductFee">
                                            <form:option value="0">&nbsp;</form:option>
                                            <form:options items="${stateFeeList}" itemLabel="label" itemValue="value"/>
                                        </form:select></td>
                                    <td width="9%"><form:input
                                            path="transactionDetails[${transaction.key}].customLabel1" size="11"
                                            maxlength="18" cssErrorClass="errorneous"/></td>
                                    <td width="7%"><form:input
                                            path="transactionDetails[${transaction.key}].customLabel2" size="11"
                                            maxlength="18" cssErrorClass="errorneous"/></td>
                                     <td align="right">
										<form:input path="transactionDetails[${transaction.key}].customerBalance" disabled="true" cssClass="disabled"/>
                                        <form:hidden path="transactionDetails[${transaction.key}].customerBalance"/>
									</td>

                                    <td><form:checkbox path="transactionDetails[${transaction.key}].checked"/></td>

                                </tr>
                            </c:if>
                        </c:forEach>
                        <tr bgcolor="#FaF7F7">
                            <td colspan="18" align="left" width="100%" style="color: green;">
                                <span style="font-weight: bold;">Notes:</span><br/>
                                "Choose Labels": If needed, Please enter text for these labels. These labels will be
                                viewed by your customer on his / her refund Check / Stub.
                            </td>
                        </tr>
                        <tr>
                        	<td colspan="18">
                        		<span style="font-weight: bold;">
                        		 <form:errors path="*" cssClass="errors"/>
                        		</span>
                        	</td>
                        </tr>
                        <tr>
                            <td colspan="18" align="left" style="padding-left:50px;" width="100%">
                           <br/>
                            	<%-- <c:choose>
                            		<c:when test="${transactions.disableApprovePayments}">
                            			<input type="button" value="Approve & Go to Place Order" name="button_order"
                                       		class='ui-button ui-state-default ui-corner-all' disabled="disabled" title="Disabled due to new transactions are already present."/>
                            		</c:when>
                            		<c:otherwise> --%>
                            			<input type="submit" value="Approve & Go to Place Order" name="button_order"
                                       		class='ui-button ui-state-default ui-corner-all'/>
                            		<%-- </c:otherwise>
                            	</c:choose> --%>
                                <input type="submit" value="Approve & Go to New Transactions" name="button_new_transactions" class='ui-button ui-state-default ui-corner-all'/>
                                <input type="submit" value="Go Back" name="button_back" class='ui-button ui-state-default ui-corner-all'/>
                                <input type="submit" value="Cancel" name="button_cancel" class='ui-button ui-state-default ui-corner-all'/>
                            </td>
                        </tr>

                    </table>
                </form:form>
            </c:otherwise>
        </c:choose>
        <div id="error" class="errors"></div>

        <script language="javascript" type="text/javascript">ch_select(true);</script>
    </div>
</div>
<%@include file="/WEB-INF/jsp/include/footer.jsp" %>
</body>
</html>